"ui";
ui.layout(
  <vertical gravity="center">
    <img id="logo" src="file://./xiaomilogo.jpg" w="200dp" h="200dp"></img>
    <horizontal w="*" h="wrap_content" gravity="center" margin="10">
      <text id="price" textSize="30sp" textStyle="bold" gravity="center">
        200
      </text>
      <text textSize="30sp" textStyle="bold">
        万
      </text>
    </horizontal>
    <seekbar id="seekbar" w="*" h="30dp" max="1000" margin="10 50 10 10" />
    <text textSize="30sp" textStyle="bold" gravity="center">
      作者: 牙叔
    </text>
  </vertical>
);

var seekbarListener = new android.widget.SeekBar.OnSeekBarChangeListener({
  onProgressChanged: function (seekbar, progress, fromUser) {
    log(progress);
    ui.price.setText(Math.floor(progress) + "");
    ui.logo.cornerRadius = progress;
  },
});
ui.post(function () {
  ui.price.setText("200");
  ui.seekbar.progress = 200;
});

ui.seekbar.setOnSeekBarChangeListener(seekbarListener);
